<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./Public/jquery-1.8.2.min.js"></script>
    <script>
        $(function () {
            //获得验证码图片的地址
            var src = $('.imgCode').attr('src');
            //点击更换图片的地址
            $('.imgCode,.imgA').click(function(){
                $('.imgCode').attr('src',src + '&mt=' + Math.random());
            })

        })
    </script>
</head>
<body>
<form action="" method="post">
    用户名: <input type="text">
    <br>
    密码: <input type="password" name="" id="">
    <br>
    验证码:<input type="text" name="" id="">
    <img src="?a=code" alt="" class="imgCode">
    <a href="javascript:;" class="imgA">看不清换一张</a>
    <br>
    <input type="submit" value="登陆">
</form>
</body>
</html>